package cn.wolfcode.trip.base.service;

import cn.wolfcode.trip.base.domain.Together;
import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.TogetherQueryObject;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

public interface ITogetherService {
    /**
     * 高级查询
     * @param qo
     * @return
     */
    PageInfo query(TogetherQueryObject qo);

    List<Together> selectAll();

    /**
     * 通过id 查询结伴游
     * @param id
     * @return
     */
    Together selectTogetherById(Long id);

    /**
     * 保存结伴游
     * @param together
     */
    void save(Together together);

    /**
     * 通过结伴游查询其所有关注的用户
     * @param togetherId
     * @return
     */
    List<User> getUserByTogetherId(Long togetherId);

    /**
     * 查询某一结伴游 是否被某一用户关注
     * @param togetherId,togetherId
     * @return
     */
    Boolean haveUser(Long togetherId,Long userId);

    /**
     * 取消关注  删除中间表的联系
     * @param togetherId
     * @param userId
     */
    void deleteFocus(Long togetherId, Long userId);

    /**
     * 关注
     * @param togetherId
     * @param userId
     */
    void saveFocus(Long togetherId, Long userId);
}
